/**
 * 普通下拉框 初始化定义以及功能调用
 */


$(document).ready(function () {

    //easyui select下拉框代码
    $("select:not([comboname])").each(function () {

        var isChange = 0;
        var obj = $(this);
        var jqueryValidClass = obj.attr("jqueryValidClass");
        var objName = obj.attr("name");
        obj.combobox({
                         panelHeight: 'auto',
                         editable: false,
                         onChange: function (n, o) {
                             obj.val(n);
                             var onchangeStr = obj.attr("onChange");
                             if (onchangeStr) {
                                 eval(obj.attr("onChange"));
                                 isChange = 1;
                                 setTimeout(function () {
                                     isChange = 0;
                                 }, 500);
                             }

                         },
                         onLoadSuccess: function () { //数据加载完毕事件
                             obj.combobox('textbox').bind('focus', function () {
                                 if (isChange == 1) {
                                     isChange = 0;
                                 } else {
                                     obj.combobox('showPanel');
                                 }
                             });

                             if (obj.attr("disabled") == "disabled") {
                                 obj.combobox("disable");
                                 $("[name='" + objName + "']").removeAttr("disabled");
                             }
                             /*if(jqueryValidClass){
                              $("input[name='"+objName+"']").attr("class",jqueryValidClass +" " +$("input[name='"+objName+"']").attr("class"));
                              }*/
                         }

                     });
    });

});
